<template>
    <Header></Header>
    <Nav></Nav>
    <div>
        <div>
            <div class="box box-height">

                <div class="login-box personal-nav">
                    <!-- Tab panes -->
                    <div class="tab-content login-form">
                        <div role="tabpanel" class="tab-pane active" id="xuefen1">
                            <div class="clearfix">
                                <div class="home-xinwen1" style="width: 100%">
                                    <ul class="list-unstyled home-news" :data="lists" :loop="false">
                                        <li v-for="(list, index) in lists" :key="index">
                                            <a :href="'/web/news/detail/' + list.id">
                                                <h3>{{ list.name }}</h3>
                                                <p>{{ list.created_at }}</p>
                                                <div>{{ list.description }}</div>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>

                    </div>

                </div>


            </div>
        </div>

    </div>
    <Footer></Footer>
</template>
<script>
import Header from "../../../components/web/Header";
import Nav from "../../../components/web/Nav";
import Footer from "../../../components/web/Footer";
export default {
    name: "List",
    components:{
        Header,
        Nav,
        Footer
    },
    setup(){
    // let store = useStore();
    // let cart = computed(() => {
    //   return store.state.cart
    // })

    // return {
    //   cart
    // }
    },
    data() {
        return {
            lists: []
        }
    },
    methods: {
        
    },
    async created(){
        try{
            // const items = await this.$http.post('/api/banner')
            const lists = await this.$http.post('/scanapi/api/v1/web/news/list')
            console.log(lists);
            this.lists = lists.data
        }catch(err){
            console.log(err)
        }
    }
}
</script>